/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MyDataContainer;

/**
 *
 * @author Welcome
 */
public class MyForeignKey {
    
    //<editor-fold defaultstate="collapsed" desc="1/Cac thuoc tinh co ban">
    private String hostTable;
    private String hostField;
    private String desTable;
    private String desField;
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="2.Cac phuong thuc khoi tao">
    public MyForeignKey()
    {
        this.hostTable = "";
        this.hostField = "";
        this.desTable = "";
        this.desField = "";
    }
    public MyForeignKey(String hostTable, String hostField, String desTable, String desField) {
        this.hostTable = hostTable;
        this.hostField = hostField;
        this.desTable = desTable;
        this.desField = desField;
    }
    
    public MyForeignKey(MyForeignKey myForeignKey) {
        this.hostTable = myForeignKey.hostTable;
        this.hostField = myForeignKey.hostField;
        this.desTable = myForeignKey.desTable;
        this.desField = myForeignKey.desField;
    }
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="3.Cac phuong thuc Getter/Setter">
    public String getDesField() {
        return desField;
    }
    
    public void setDesField(String desField) {
        this.desField = desField;
    }
    
    public String getDesTable() {
        return desTable;
    }
    
    public void setDesTable(String desTable) {
        this.desTable = desTable;
    }
    
    public String getHostField() {
        return hostField;
    }
    
    public void setHostField(String hostField) {
        this.hostField = hostField;
    }
    
    public String getHostTable() {
        return hostTable;
    }
    
    public void setHostTable(String hostTable) {
        this.hostTable = hostTable;
    }
    //</editor-fold>
    
    //<editor-fold defaultstate="collapsed" desc="4/Cac phuong thuc xu ly nghiep vu">
    public void showForeignKey()
    {
        System.out.println(hostTable + " " + hostField + " " + desTable +" "+desField);
    }
    
    public void setFKey(String[] fKey)
    {
        if (fKey.length==4)
        {
            hostTable=fKey[0];
            hostField=fKey[1];
            desTable=fKey[2];
            desField=fKey[3];
        }
        
    }
    //</editor-fold>
}
